//
//  ClassifyHeader.swift
//  Eternity
//
//  Created by cll12_12 on 2016/12/5.
//  Copyright © 2016年 ZhengWei. All rights reserved.
//

import UIKit

class ClassifyHeader: UICollectionReusableView {
    
    // MARK: - life cycle
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        initBaseLayout()
        layoutPageSubviews()
        self.backgroundColor = UIColor.white
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    // MAKR: - private method
    func initBaseLayout() -> Void {
        self.addSubview(titleLabel)
    }
    
    func layoutPageSubviews() -> Void {
        titleLabel.snp.makeConstraints { (make) in
            make.centerX.centerY.equalTo(self)
            make.width.equalTo(48)
            make.height.equalTo(14)
        }
    }
    
    func configUI() {
        titleLabel.text = "护肤保养"
    }
    
    // MARK: - setters and getters
    var _titleLabel: UILabel!
    var titleLabel: UILabel {
        if _titleLabel == nil {
            _titleLabel = UILabel()
            _titleLabel.font = UIFont(name: "PingFang-SC-Regular", size: 12)
            _titleLabel.textColor = UIColor(hexString: "#252525")
            _titleLabel.textAlignment = .center
        }
        return _titleLabel
    }
}
